﻿@* Override default Decimal template to display value in bold and ignore Html attributes in ViewData. *@
@using System.Globalization

@functions {
    private object FormattedValue {
        get {
            if (ViewData.TemplateInfo.FormattedModelValue == ViewData.ModelExplorer.Model) {
                return string.Format(CultureInfo.CurrentCulture, "{0:0.00}", ViewData.ModelExplorer.Model);
            }
            return ViewData.TemplateInfo.FormattedModelValue;
        }
    }
}

@Html.TextBox(
    expression: null,
    value: FormattedValue,
    htmlAttributes: new { @class = "text-box single-line", style = "font-weight: bold", })